package cz.najman.emdroid.utils;

import cz.najman.emdroid.exception.WrongNumberOfParametersException;
import android.net.Uri;

/**
 * Interface for utility class, ensuring switching between uris
 * E.g. Between Local uries for content providers and remote REST uris.
 * @author Lukas Najman
 *
 */
public interface UriSwitcher {

	/**
	 * Finds the corresponding uri to <b>originalUri</b> and replace
	 * the occurrences of wildcard # with runtime parameters.
	 * 
	 * @param originalUri Internal uri resource	 * 
	 * @param parameters String[] containing the runtime parameters to be placed
	 * 			into remote uri instead of # wildcards. The wildcards should be replaced in the 
	 * 			order of the occurrence in the uri and the String array.
	 * @return Corresponding uri to originalUri. Null if no match found.
	 * @throws WrongNumberOfParametersException 
	 */
	public Uri switchUri(Uri localUri, String[] parameterTypes, String[] parameterValues) throws WrongNumberOfParametersException;	
	
}
